package com.ruoyi.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.domain.UserHealthReminder;
import com.ruoyi.service.UserHealthReminderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/kangyue/userhealthreminder")
public class UserHealthReminderController extends BaseController {

    @Autowired
    private UserHealthReminderService userHealthReminderService;

    /**
     * 根据用户ID获取健康提醒
     *
     * @param userId 用户ID
     * @return 健康提醒列表
     */
    @GetMapping("/getByUserId")
    public TableDataInfo getHealthReminders(@RequestParam Long userId) {
        List<UserHealthReminder> list = userHealthReminderService.getHealthRemindersByUserId(userId);
        return getDataTable(list);
    }
}

